<?php
require_once("bootstrap.php");
class markup_configs_helper
{
var $config_id;
var $markup_array= array();
public static function get_all_markup()
{
$q= Doctrine_Query::create();
$q->select("a.*,b.*")->from("MarkupConfigs a")->leftJoin('a.MarkupRule b');
return $q->execute()->toArray();
}
public static function get_markup_by_config($config_id)
{
$q= Doctrine_Query::create();
$q->select("a.*,b.*")->from("MarkupConfigs a")->leftJoin('a.MarkupRule b')->where("a.config_id ='$config_id'");
return $q->execute()->toArray();
}
public static function get_markup_rule_by_rule_id($rule_id)
{
//echo $rule_id;
 $q=Doctrine_Query::create();
 $q->select("a.*")->from("MarkupRules a")->where("a.idmarkup_rules='$rule_id'");
 $ele= $q->execute()->toArray();                                        
 return $ele[0];
}
}
?>
